﻿@model IEnumerable<RecommendItem>
@{BlogSettings blogSettings = new BlogSettings();}
@if (Model != null && Model.Count() > 0)
{
    Dictionary<long, IUser> usersDic = ViewData.Get<Dictionary<long, IUser>>("users", null);
    <div class="tn-box tn-widget tn-widget-content tn-corner-all spb-pop-attention">
        <div class="tn-box-header tn-widget-header tn-border-gray tn-border-bottom ">
        <div class="tn-option">
            @if (new Authorizer().RecommendItem_Manage(TenantTypeIds.Instance().User()))
            {
            <a href="@SiteUrls.Instance()._ManageRecommendItems(blogSettings.RecommendUserTypeId,false)" plugin="dialog">管理</a>
            }
        </div>
        <h3 class="tn-helper-reset">@Model.First().RecommendItemType.Name</h3>
        </div>
        <div class="tn-box-content tn-widget-content tn-corner-bottom ">
        <ul class="tn-person-rank">
            @foreach (var item in Model)
            {
                <li class="tn-border-dashed tn-border-gray tn-border-bottom">
                    <div class="tnc-list-topic">
                        @Html.ShowUserAvatar(item.ItemId, avatarSizeType: AvatarSizeType.Micro)
                        @if (item.IsLink)
                        { 
                            @Html.Link(item.ItemName, item.LinkAddress, item.ItemName, new { @class = "tn-user-name" }, navigateTarget: HyperLinkTarget._blank)
                        }
                        else
                        { 
                            @Html.Link(item.ItemName, SiteUrls.Instance().Blog(UserIdToUserNameDictionary.GetUserName(item.ItemId)), item.ItemName, new { @class = "tn-user-name" }, navigateTarget: HyperLinkTarget._blank)
                        }
                    </div>
                </li>
            }
        </ul>
        </div>
    </div>
}